
/*
Implement strStr().
Returns the index of the first occurrence of needle in haystack, 
or -1 if needle is not part of haystack.
"seda"
"ae"
=> -1
"seda"
"e"
=> 1
"seda"
"da"
=> 2
*/
public class Solution{
	public int strStr(String haystack, String needle) {
		if(haystack.length()==0 && needle.length()==0)
			return 0;
		if(haystack.length()==0)
			return -1;
		if(needle.length()==0)
			return 0;
		return haystack.indexOf(needle);
	}
	
	public static void main(String[] args){
		Solution solution = new Solution();
		String param1 = "";
		String param2 = "";
		if(args.length!=0){
			param1 = args[0];
			param2 = args[1];
		}
		int res = solution.strStr(param1,param2);
		System.out.println(res);
	}
}